﻿
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>

<body>
<table border="0" align="center">
       <tr>
	      <td>
					<form name="f" method="post" >
									  <table width="400"  border="0"  align="center" style="border:1px solid #0066FF" cellpadding="0" cellspacing="0">
									  
									  
											<tr bordercolor="#FFFFFF"> 
												  <td height="35" colspan="2" align="center" background="image/bg_header.gif">
									<span style="font-size:24px; color:#FFFFFF; font-weight:bold;">Kết Quả Đánh Giá Học Phần </span>
												 </td>
											
											</tr>
											
											<tr height="10"  bordercolor="#FFFFFF" >  
												  <td   align="center" colspan="2">
											
												  </td>
													
											</tr>
											<tr height="30"  bordercolor="#FFFFFF" >  
												  <td  style="font-size:18px; " align="center" width="200">
														Học Kì:
												  </td>
												  <td  align="left" width="200">
														<select name="hk" id="hk" >
																   
														 <?php 
																$sql=mysql_query("select distinct (hocki) from `hocki nienkhoa` where hocki != (select hocki from `hocki nienkhoa` where ma_hknk=(select max(ma_hknk) from `hocki nienkhoa`)) "); 
																 while($r=mysql_fetch_row($sql))
																 {
																	
																	$hk=$r[0];
																	
														 ?>
																	<option ><?php echo  $hk; ?> </option>
														<?php 
																 }//ngoac while
														?>
														<?php         $sql1=mysql_query("select * from `hocki nienkhoa` where ma_hknk=(select max(ma_hknk) from `hocki nienkhoa`)");
																	  $r1=mysql_fetch_row($sql1);
																	  $hk=$r1[1];
														?>
																 <option  selected="selected"><?php  echo $hk;?> </option>
																   
														</select>
												  </td>
												  
											</tr>
											<tr height="30"  bordercolor="#FFFFFF" >  
												  <td  style="font-size:18px;" align="center" width="200" >
														Niên Khóa:
												  </td>
												  <td align="left" >
														<select name="nk" id="nk">
																  <?php
																$sql=mysql_query("select distinct(nienkhoa)  from `hocki nienkhoa` where nienkhoa != (select nienkhoa  from `hocki nienkhoa` where ma_hknk=(select max(ma_hknk) from `hocki nienkhoa`)) "); 
																 while($r=mysql_fetch_row($sql))
																 {
																	
																	$nk=$r[0];
														 ?>
																	<option ><?php echo  $nk; ?> </option>
														<?php 
																 }//ngoac while
														?>
														<?php         $sql1=mysql_query("select *  from `hocki nienkhoa` where ma_hknk=(select max(ma_hknk) from `hocki nienkhoa`)");
																	  $r1=mysql_fetch_row($sql1);
																	  $nk=$r1[2];
														?>
																 <option  selected="selected"><?php  echo $nk;?> </option> 
														</select>
												  </td>
												  
											</tr>
											<tr height="30"  bordercolor="#FFFFFF" >  
												  <td   align="center" colspan="2">
														<input type="submit" name="tk" value="Tìm Kiếm" />
												  </td>
													
											</tr>				
											<tr height="10"  bordercolor="#FFFFFF" >  
												  <td   align="center" colspan="2">
											
												  </td>
													
											</tr>	
										   
									</table>
					</form>
				</td>
			</tr>
			<tr><td height="30">&nbsp;</td></tr>
		<?php
		     if(isset($_POST["tk"]))
			 {
		 ?>	
			 <!--hâng thu 2 -->
			<tr>
			     <td>
				     <?php
					            $cnk=$_SESSION['cnk']; 
								$sql=mysql_query("select * from khoa where username='$cnk'");
								$r=mysql_fetch_row($sql);
								$tenkhoa=$r[1];
								$makhoa=$r[0];
								$hocki=$_POST["hk"]; 
								$nienkhoa=$_POST["nk"]; 
								$nienk="$nienkhoa";
								$str=mysql_query("select * from `hocki nienkhoa` where hocki='$hocki' and nienkhoa = '$nienk' ");
							    $t=mysql_fetch_array($str);
								$hknk=$t[0];
								$str1=mysql_query("select  distinct(d.ma_gv),d.ten_gv,d.email_gv,e.ten_bm from `giang vien` d, `bo mon` e,`lop hoc phan` b where  d.ma_bm=e.ma_bm and e.ma_khoa='$makhoa' and ma_hknk='$hknk' and b.ma_gv=d.ma_gv ");
								$count=mysql_num_rows($str1);
								if($count > 0)
								{
								?>
									 
									<table width="850"  border="1"  align="center" bordercolor="#0066FF" cellpadding="0" cellspacing="0">
				  
				  
											<tr bordercolor="#FFFFFF"> 
												  <td height="35" colspan="5" align="center" background="image/bg_header.gif" class="bg2 bg3 bg4">
									<span style="font-size:24px; color:#FFFFFF; font-weight:bold;">Danh Sách Cán Bộ Giảng Dạy  </span>
									<span style="font-size:20px; color:#FFFFFF; font-weight:bold;">( Học Kì: <?php echo $hocki; ?> - Niên Khóa: <?php echo $nienk; ?> )</span>
												 </td>
											
											</tr>
						
						
											<tr height="30"  bordercolor="#FFFFFF" >  
												  <td  style="font-size:18px; font-weight:bold" align="center" width="80"  class="bg bg3">
														Mã CB
												  </td>
												  <td  style="font-size:18px; font-weight:bold" align="center" width="200"  class="bg">
														Tên Cán Bộ
												  </td>
												  
												  <td  style="font-size:18px; font-weight:bold" align="center" width="200" class="bg">
														Email Cán Bộ
												  </td>
												  <td  style="font-size:18px; font-weight:bold" align="center" width="220" class="bg">
														Bộ Môn
												  </td>
												  <td  style="font-size:18px; font-weight:bold" align="center" width="150"  class="bg1 bg4">
														Thống Kê Kết Quả
												  </td>
											</tr>
						
				<?php 
				
				while ($kq = mysql_fetch_row($str1) )
				{
				   $ma_gv = $kq[0];
				   $ten_gv = $kq[1];
				   $email_gv= $kq[2];
				   $bm_gv=$kq[3];
				   
				   ?>
				   
											<tr   bordercolor="#FFFFFF" height="25" >  
												  <td   align="center"   class="bg bg3" style="font-size:20px;">
														<?php echo $ma_gv; ?>
												  </td>
												  <td   align="center"   class="bg" style="font-size:20px;">
														<?php echo $ten_gv; ?>
												  </td>
												 
												  <td   align="center" class="bg" style="font-size:20px;">
														<?php echo $email_gv; ?>
												  </td>
												  <td   align="center"  class="bg" style="font-size:20px;">
														<?php echo $bm_gv; ?>
												  </td>
												  <td  style="font-size:20px; font-weight:bold" align="center"   class="bg1 bg4">
														 <a class="mo" href="<?php echo "cnk-tcthongke.php?nav=kqgv&&ma=$ma_gv&&hk=$hknk";?>">Xem</a> 
												  </td>
											</tr>
									   
				<?php
				 }//ngoac while
				 
				?>	
											  
				    </table>
					<?php }//ngoac if trong ?>
				 </td>
			</tr>
			<?php
			}//ngoac if
			?>
				
	</table>
</body>
</html>
